<!DOCTYPE html>
<html>
<head>
    <title>发货</title>
<!--    <script src="--><?php //echo $base_url; ?><!--static/js/jquery-3.2.1.min.js"></script>-->
</head>
<body>
<!--http://www.yangyueyuan.com/ajax/order/updateOrderStatusById?suitecode=*****&orderdetailid=121212121-->
<script type="text/javascript">



//    $(document).ready(function () {
//      $('#code').focus();//获取焦点
//    });

    $(function () {

        $('#btn-send').on('click',function () {
        var code_id = $('#code-id').val();
        var order_id = $('#order-id').val();
        var express_id = $('#express-id').val();
        var express_company_id = $('#express-company-id').val();

//        console.log(code_id + '---' + order_id);

        if (code_id == "" || order_id == "") {
            alert("套装码和订单号不能为空！");
        }

            // 绑定套装码
            $.post("http://device-cherish.fitcome.net/suitactivity/bindActivityBySuitCode",{
            suit_code : code_id,
            activity_id : "123",
            order_detail_id : order_id

        }, function (json) {

            if (json.result == 0) {

                console.log("绑定套装码 success!");
            } else {
                alert(json.errormsg);
            }

        }, 'json')

         // 修改订单详情套装码+修改订单状态
         $.getJSON("/ajax/order/updateOrderStatusById?suitecode=" + code_id + "&orderdetailid=" + order_id, function (json) {

                if (json.result == 0) {
                    console.log("修改订单详情套装码+修改订单状态 success!");
                } else {
                    alert(json.errmsg);
                }

            });
        });







    });


    window.onload = function () {

        document.getElementById("code-id").focus();
    }


</script>

<style>

    /*.form-box {*/
        /*height: 60px;*/
        /*width: 500px;*/
        /*position: relative;*/
        /*!*background-color: palegoldenrod;*!*/
    /*}*/

    /*.input-box {*/
        /*width: 300px;*/
        /*height: 36px;*/
        /*!*background-color: rebeccapurple;*!*/
        /*position: relative;*/
        /*left: 100px;*/
        /*top: -52px;*/
    /*}*/

    /*.tit {*/
        /*width: 100px;*/
        /*height: 36px;*/
        /*text-align: center;*/
        /*position: relative;*/
        /*top: 6px;*/
        /*!*background-color: red;*!*/
    /*}*/

    /*button {*/
        /*position: relative;*/
        /*left: 36px;*/
        /*width: 100px;*/
        /*height: 60px;*/
        /*background-color: palegoldenrod;*/
        /*!*border: hidden;*!*/
    /*}*/
</style>


<div class="tpl-content-wrapper">
    <div class="row-content am-cf">
        <div class="row">
            <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title  am-cf">发货</div>
                </div>
                    <div class="widget-body am-fr">


                        <div class="row">
                        <div class="am-form-group am-u-lg-12">
                            <label for="user-weibo" class="am-u-sm-2 am-form-label">套装码:</label>
                            <div class="am-u-sm-10">
                                <input class="input-box" id="code-id" type="text" name="code">
                            </div>
                        </div>
                        </div>
                        <div class="row">
                        <div class="am-form-group am-u-lg-12">
                            <label for="user-weibo" class="am-u-sm-2 am-form-label">订单号:</label>
                            <div class="am-u-sm-10">
                                <input class="input-box" id="order-id" type="text" name="order">
                            </div>
                        </div>
                        </div>

                        <div class="row">
                            <div class="am-form-group am-u-lg-12">
                                <label for="user-weibo" class="am-u-sm-2 am-form-label">快递单号:</label>
                                <div class="am-u-sm-10">
                                    <input class="input-box" id="express-id" type="text" name="order">
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <div class="am-form-group am-u-lg-12">
                                <label for="user-weibo" class="am-u-sm-2 am-form-label" style="line-height: 35px;">快递公司:</label>
                                <div class="am-u-sm-10">
                                    <select data-am-selected="{btnSize: 'sm'}" name="express-company-id" id='express-company-id'>
<!--                                        <option value="0" >快递公司</option>-->
                                        <option value="1" >顺丰</option>
                                        <option value="2" selected>圆通</option>
                                    </select>
                                </div>
                            </div>
                        </div>

                        <div class="am-u-sm-6 am-u-md-6 am-u-lg-6">
                            <div class="am-form-group">
                                <div class="am-btn-toolbar">
                                    <div class="am-btn-group am-btn-group-xs">
                                        <button id="btn-send" class="am-btn am-btn-default am-btn-success" style="width: 100px;">发货</button>

                                    </div>
                                </div>
                            </div>
                        </div>

                    </div>


                </div>
            </div>
        </div>

    </div>


</div>



<button type="button" onclick="">发货</button>
<p id="result"></p>

</body>
</html>
